# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         demo17
# Description:
# Author:       98745
# Date:         2019/6/10
#-------------------------------------------------------------------------------

from wtforms import TextField,SubmitField,validators
from flask import Flask,request,render_template
from flask_wtf import FlaskForm

app=Flask(__name__)
app.secret_key='panyanzhen12345677'
class ContactFrom(FlaskForm):
    firstname=TextField('姓名',[validators.Required('姓名必须输入')])
    submit=SubmitField('提交')

@app.route('/',methods=['GET','POST'])
def ConcatO():
    form=ContactFrom()
    if request.method=='POST':
        if form.validate_on_submit()==False:
            print(form.firstname.errors)
            print('error')
    return render_template('first.txt',form=form)

if __name__ == '__main__':
    app.run()